/* ring_buffer.h */
#ifndef __RING_BUFFER_H__
#define __RING_BUFFER_H__

#include <stdint.h>
#include <stdbool.h>

typedef struct
{
    uint32_t BufferSize; /* Keep the available count of byte in buffer's memory */
    uint8_t *BufferPtr;  /* Keep the first pointer to the buffer's memory. */
    uint32_t ReadIdx;
    uint32_t WriteIdx;
} RBUF_Handler_T;

bool RBUF_Init(RBUF_Handler_T *handler, uint8_t *bufPtr, uint32_t size);
bool RBUF_IsEmpty(RBUF_Handler_T *handler);
bool RBUF_IsFull(RBUF_Handler_T *handler);
void RBUF_PutDataIn(RBUF_Handler_T *handler, uint8_t dat);
uint8_t RBUF_GetDataOut(RBUF_Handler_T *handler);

#endif /* __RING_BUFFER_H__ */
